#ifndef __GS_ENV_H__
#define __GS_ENV_H__

struct aeEventLoop;
struct Array;
struct Client;

typedef struct Env {
    struct aeEventLoop* el;
    int listenfd;
    int loglevel;
    char host[64];
    int port;
    int run_daemonize;
    char* logfile;

    struct Array* clients;
    void (*AddClient)(struct Env* env, struct Client* client);
    void (*RemoveClient)(struct Env* env, struct Client* client);

    struct HashTable* games; // <Slice/Game>
    struct Game* (*AutoJoinIn)(struct Env* env, struct Client* client); 
    struct Game* (*Leave)(struct Env* env, struct Client* client);
    struct Game* (*DoAction)(struct Env* env, struct Client* client, int action);
} Env;

Env* EnvCreate();
void EnvDestroy(struct Env* env);
Env* EnvParseArgs(int argc, char** argv);

#endif
